4.4 Archiving the System Events
To create an archive database to store your system events, run the MyID installation program to create an archive database. See section 4.1, Creating an archive database for details. Once you have created the new empty database, you must configure the following data link files to point to the new database:
-
<databasename>archive.udl
where <databasename> is the name of the main MyID database ; for example, MyIDarchive.udl
-
importarchive.udl
See section 4.1.1, Configuring the data link files for details.
You can set up MyID to archive the contents of the system events table in the MyID database periodically in a similar way to archiving the Audit table; see section 4.3, Archiving the audit trail.
You can use the LogEventsArchive table, and a stored procedure, sp_ArchiveLogEvents.
Set up a SQL Timed Task on your MyID database to run the sp_ArchiveLogEvents procedure periodically. The syntax is as follows:
sp_ArchiveLogEvents '<archivedatabase>', <daysOld>
where:
-
<archivedatabase> is the name of the database that will store the archived data.
-
If a single database is being used to store both live and archive information, then the value of <archivedatabase> will be the same as main MyID database. The data will be moved into a separate table.
-
If the archive database name begins with numbers, you must enclose the database name in square brackets. For example:
sp_ArchiveLogEvents '[20100101_CMSArchive]', 90
-
If the archive database exists on a different server, you must configure this as a named "linked server" within SQL Enterprise manager.
The <archivedatabase> would then be specified as:
<LinkedServerName>.<ArchiveDatabaseName>
where:
- <LinkedServerName> is the name of the linked server.
- <ArchiveDatabaseName> is the name of the archive database on that server.
-
-
<daysOld> is the age of data, in days, that will be archived.
For example:
sp_ArchiveLogEvents 'ArchiveDB', 90